package com.windgo.controller.wx;

import com.windgo.bean.common.BaseRespVo;
import com.windgo.bean.wxVo.WxCategoryVo1;
import com.windgo.bean.wxVo.WxCategoryVo2;
import com.windgo.service.CategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author zlh
 * @since 2022/10/14 14:25
 */

@RestController
@RequestMapping("wx/catalog")
public class UserCatelogController {


    @Autowired
    CategoryService categoryService;


    @GetMapping("current")
    public BaseRespVo current(Integer id){
        WxCategoryVo1 wxCategoryVo1 = categoryService.selectCategoryById(id);
        return BaseRespVo.ok(wxCategoryVo1);
    }

    @GetMapping("index")
    public BaseRespVo index(){
        WxCategoryVo2 wxCategoryVo2 = categoryService.selectAllCategoty();
        return BaseRespVo.ok(wxCategoryVo2);
    }


}
